package com.kly.module_base.utils

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable

object DrawableUtil {
    /**
     * 获取Drawable
     *
     * @return
     */
    @SuppressLint("UseCompatLoadingForDrawables")
    fun getDrawable(context: Context?, resId: Int?): Drawable {
        val drawable: Drawable = resId?.let { context?.resources?.getDrawable(it,null) }!!
        drawable.setBounds(0, 0, drawable.minimumWidth, drawable.minimumHeight)
        return drawable
    }
}